package 力扣日常刷题.木22一月.第02天0109;

/**
 * @author 帅小伙
 * @date 2022/1/9
 * @description https://leetcode-cn.com/problems/subrectangle-queries/
 */
public class Demo06数组子矩阵查询 {
    int[][] rectangle;

    public Demo06数组子矩阵查询(int[][] rectangle) {
        this.rectangle = rectangle;
    }

    public void updateSubrectangle(int row1, int col1, int row2, int col2, int newValue) {
        for (int i = row1; i <= row2; i++) {
            for (int j = col1; j <= col2; j++) {
                this.rectangle[i][j] = newValue;
            }
        }
    }

    public int getValue(int row, int col) {
        return this.rectangle[row][col];
    }

}
